from application import app,manager
from flask_script import Server
import www
from jobs.launcher import runJob
#web server (自定义你的启动命令)
manager.add_command("runserver",Server(host = '0.0.0.0',port = app.config['SERVER_PORT'], use_debugger = True,use_reloader = True ))

'''
封装类统一入口调用
'''

#job entrance
manager.add_command('runjob',runJob() )
def main():
    manager.run()

if __name__ == '__main__':
    try:
        import sys
        sys.exit( main() )
    except Exception as e:
        #引入python中打印错误的包
        import traceback

        traceback.print_exc()